﻿#ifndef DIALOG_H
#define DIALOG_H

#include "common/baseeditor.h"
#include <head/m_message.h>

namespace Ui {
class Dialog;
}

class Dialog : public BaseEditor
{
    Q_OBJECT

public:
    explicit Dialog(QWidget *parent=nullptr,Qt::WindowFlags f=Qt::Dialog);
    ~Dialog();

    void updateDateList();
    void updateView();
    void do_updateView(const QString &date);
    void generateMenu();
    bool addItem(const QString &ticket);
    void setHeaderData();
    void exportData();
    void detectSpecMode();
    void keyPressEvent(QKeyEvent *);

private slots:
    void on_listView_doubleClicked(const QModelIndex &index);
    void on_ticket_returnPressed();
    void on_search_returnPressed();

private:
    Ui::Dialog *ui;

    bool isSpecMode;
    QString selectDate;
    QString today;
    QStringList history;
    QStringListModel *listModel;
};

#endif // DIALOG_H
